package com.example.lanouhn.bantangapp.activities.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by lanouhn on 16/7/19.
 */
public class VpSelectedAdapter extends FragmentPagerAdapter {
    private List<String> tabNames;
    private List<Fragment> fragments;

    public VpSelectedAdapter(FragmentManager fm, List<String> tabNames, List<Fragment> fragments) {
        super(fm);
        this.tabNames = tabNames;
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return tabNames.get(position);
    }
}

